﻿<controls:ChildWindow x:Class="Reactor.Client.Views.ModalDialog"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:local="clr-namespace:Reactor.Client.Controls" 
    xmlns:controls="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls" 
    xmlns:Converters1="clr-namespace:Reactor.Client.Converters" mc:Ignorable="d"
    d:DesignHeight="300" d:DesignWidth="400">
    <controls:ChildWindow.Resources>
        <Converters1:ViewTemplateConverter x:Key="TemplateChooser" />
    </controls:ChildWindow.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <local:BusyIndicator x:Name="busyIndicator" 
                             BusyContent="{Binding Path=ApplicationStrings.BusyIndicatorSendingAdoptionCommand, Source={StaticResource ResourceWrapper}}"
                             IsBusy="{Binding IsBusy}" Margin="10">
            <ContentControl Content="{Binding FormContent, Converter={StaticResource TemplateChooser}}" />
        </local:BusyIndicator>

        <StackPanel Grid.Row="1" Grid.Column="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,10,0">
            <Button Content="{Binding Path=ApplicationStrings.OKButton, Source={StaticResource ResourceWrapper}}" 
                    Style="{StaticResource RegisterLoginButtonStyle}" Command="{Binding SubmitCommand}"
                    IsEnabled="{Binding CanSave, Mode=OneWay}" />

            <Button Content="{Binding Path=ApplicationStrings.CancelButton, Source={StaticResource ResourceWrapper}}" 
                    Style="{StaticResource RegisterLoginButtonStyle}" Command="{Binding CancelCommand}" />
        </StackPanel>
    </Grid>
</controls:ChildWindow>
